Skip to main content

Styles

Styles property allows you to apply custom styles to the MagicMotion component.

Example

import { MagicMotion } from 'magic-motion';

const App = () => {
const [animateTo, setAnimateTo] = useState();

const buttonHandler = () => {
setAnimateTo('Hello my friends');
};

return (
<>
<MagicMotion
initialContent="Hello World!!!"
animateTo={animateTo}
styles={{
background: '#111',
color: '#aaa',
}}
/>
<button onClick={buttonHandler}>Animate</button>
</>
);
};

export default App;